<!-- 管理学生信息 -->
<template>
	<view class="container">
		<view class="c-cell">
			<view class="c-cell" @click="toTeacherInfo">
				<u-cell-group>
					<u-cell v-for="item in teacherList" :key="item.id" :data-id="item.id" icon="setting-fill"
						:title="item.name" label="点击查看详细信息" value="钢琴老师" size="large"></u-cell>
				</u-cell-group>
			</view>
		</view>
		<view class="c-empty" v-if="teacherList.length==0">
			<u-empty icon="/static/empty/list.png" text="暂无教师信息" textSize="18" marginTop="25%" width="80%"></u-empty>
		</view>
	</view>
</template>

<script>
	export default {
		name: "",
		data() {
			return {
				// 老师列表
				teacherList: [],
				query:{
					page:1,
					page_size:10
				}
			}
		},
		onShow() {
			this.getOrgTeacherList()
		},
		onReachBottom(){
			this.query.page+=1
			this.getOrgTeacherList()
		},
		methods: {
			// 跳转老师信息
			toTeacherInfo(e) {
				if (e.target.dataset.id) {
					this.navigateTo("orgTeacherInfo?id=" + e.target.dataset.id)
				}
			},
			// 获取老师信息列表
			getOrgTeacherList() {
				this.$http.getOrgTeacherList(this.query).then(res => {
					this.teacherList = this.teacherList.concat(res.data)
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.container {}
</style>
